SNOW-1897976: adding pipe method to DataFrame#4178
SNOW-1897976: adding pipe method to DataFrame#4178Tijoxa wants to merge 8 commits intosnowflakedb:mainfrom
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
sfc-gh-joshi
left a comment
There was a problem hiding this comment.
Thank you for your contribution. Please take a look (or have your agent take a look) at the comments I left.
Since this is a new API, please also add DataFrame.pipe to our API documentation reference in https://github.com/snowflakedb/snowpark-python/blob/main/docs/source/snowpark/dataframe.rst, and add a corresponding entry to CHANGELOG.md.
One question (mostly out of curiosity): is there a reason the github account you used to create the PR is different from the account that you used to create commits?
| df._plan._metadata = PlanMetadata( | ||
| attributes=[ | ||
| Attribute("A", IntegerType(), False), | ||
| Attribute("B", StringType()), | ||
| ], | ||
| quoted_identifiers=None, | ||
| ) |
There was a problem hiding this comment.
It looks like you copied this example from test_dataFrame_printSchema in the same file, but we should avoid modifying internal dataframe attributes during tests whenever possible. I don't think this is necessary for this test regardless.
Also, please modify test_func to actually do something to the dataframe, since right now it's a no-op and not really a meaningful test.
There was a problem hiding this comment.
With the new commits, I've updated the tests and tried to put the test at the correct place. However, I don't know if I should put it under tests/unit/test_dataframe.py, tests/integ/test_dataframe.py or any other directory.
|
Hi, thank you for your feedbacks. |
|
I have read the CLA Document and I hereby sign the CLA |
|
It looks like there's some linting issues from CI: https://github.com/snowflakedb/snowpark-python/actions/runs/24531983812/job/71867812441?pr=4178 Please install pre-commit, which will automatically run isort/flake8/black on your dev machine when you make a commit. I can kick off the CI test suite for you once that's fixed. |
The linting issue pointed at the CI points to what my local formatter (Ruff) signals. However, it has not been fixed by the pre-commit that I've just installed. The pre-commit hook even flagged another line in the codebase that I haven't touched (it wants to use f-strings): That may be due to the difficulties I've encountered for running pre-commit (I use uv on a Windows machine)... Anyway I hope that the CI is happy now! |
|
It seems like we had some recent changes to our internal auth mechanisms that prevent CI from running properly for external contributions. I've kicked off CI for this PR in #4189, which hopefully should pass. |
Do you mean that the merge is happening on your branch? Do you need me to do anything particular in #4189 , like signing the CLA Document? |
|
I just need reviews from team members to approve the PR. It might take a bit to get merged, but we'll try to get it in before our next release cut. |
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1897976
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
This simple
pipemethod mimics the functionality of similar pipe methods in popular libraries like pandas or polars.